package com.qf.springboot.demoredis.manager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @Auther: Adrian
 * @Date: 2020/3/9 18:08
 * @Description:redis数据库库访问
 */
@Component
public class RedisManager {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;


    public void addValueKey(String key,String vlaue){
        stringRedisTemplate.opsForValue().set(key,vlaue);
    }


    public String getValueForKey(String key){

        return stringRedisTemplate.opsForValue().get(key);
    }
}
